/* SUPER MARKET SYSTEM */ #include #include #include #include using namespace std; class product { int pno; char name[8]; int price,qty,tax,dis; int flag,no,found; public: void write_product(); void display_all(); void display_sp(int); void modify_product(); void delete_product(); void menu(); void place_order(); void admin_menu(); void create_product() { cout<<"\nPlease Enter The Product No. of The Product "; cin>>pno; cout<<"\n\nPlease Enter The Name of The Product "; cin>>name; cout<<"\nPlease Enter The Price of The Product "; cin>>price; cout<<"\nPlease Enter The Discount (%) "; cin>>dis; } void show_product() { cout<<"\nThe Name of The Product : "; cin>>name; cout<<"\nThe Product No. of The Product : "<>ch; switch(ch) { case 'a': pr.place_order(); getch(); break; case 'b': pr.admin_menu(); break; case 'c': break; default :cout<<"invalid option";} return 0; } void product::write_product() { char rd; pr.create_product(); cout<<"\n\nThe Product Has Been Created \n"; pr.admin_menu(); getch(); } //*************************************************************** // function to read all records //**************************************************************** void product::display_all() { cout<<"\n\n\n\t\tDISPLAY ALL RECORD !!!\n\n"; pr.show_product(); cout<<"\n\n====================================\n"; getch(); } //*************************************************************** // function to read specific record //**************************************************************** void product::display_sp(int n) { pr.flag=0; if(pr.retpno()==n) { pr.show_product(); pr.flag=1; } if(pr.flag==0) cout<<"\n\nrecord not exist"; getch(); } //*************************************************************** // function to modify record //**************************************************************** void product::modify_product() { pr.no,pr.found=0; cout<<"\n\n\tTo Modify "; cout<<"\n\n\tPlease Enter The Product No. of The Product"; cin>>pr.no; if(pr.retpno()==pr.no) { pr.show_product(); cout<<"\nPlease Enter The New Details of Product"<>pr.no; cout<<"\n\n\tRecord not found.."; getch(); } //*************************************************************** // function to display all products price list //**************************************************************** void product::menu() { cout<<"ERROR!!! FILE COULD NOT BE OPEN\n\n\n Go To Admin Menu to create File"; cout<<"\n\n\n Program is closing ...."; getch(); cout<<"\n\n\t\tProduct MENU\n\n"; cout<<"====================================================\n"; cout<<"P.NO.\t\tNAME\t\tPRICE\n"; cout<<"====================================================\n"; cout<>bn; cout<<"\n\nEnter The Product No. Of The Product : "; cin>>order_arr[c]; cout<<"\nQuantity in number : "; cin>>quan[c]; cout<<"\nDo You Want To Order Another Product ? (y/n)"; cout<<"\n\nThank You For Placing The Order";getch(); cout<<"\n\n********************************INVOICE************************\n"; cout<<"\nPr No.\tPr Name\tQuantity \tPrice \tAmount \tAmount after discount\n"; for(int x=0;x<=c;x++) { if(pr.retpno()==order_arr[x]) { amt=pr.retprice()*quan[x]; damt=amt-(amt*pr.retdis()/100); cout<<"\n"<>ch2; switch(ch2) { case 'a': pr.write_product(); break; case 'b': pr.display_all();break; case 'c': int num; cout<<"\n\n\tPlease Enter The Product No. "; cin>>num; pr.display_sp(num); break; case 'd': pr.modify_product();break; case 'e': pr.delete_product();break; case 'f': pr.menu(); getch(); case 'g': pr.admin_menu(); break; default: cout<<"invalid option"; pr.admin_menu(); } } //*************************************************************** // END OF PROJECT //***************************************************************